﻿using System;
using Spring.Context;
using Spring.Context.Support;

namespace SpringSeries.Core.TypeMatching
{
    class Program
    {
        static void Main(string[] args)
        {            
            IApplicationContext _ctx = ContextRegistry.GetContext();

            Person _person = (Person)_ctx.GetObject("Matteo");
            Console.WriteLine(_person.FirstName);
            Console.WriteLine(_person.Age);

            Console.WriteLine();

            //Person2 _person2 = (Person2)_ctx.GetObject("Matteo2");
            //Console.WriteLine(_person2.FirstName);
            //Console.WriteLine(_person2.LastName);
            //Console.WriteLine(_person2.Age);

            Console.Read();
        }
    }
}
